<?php

class Forms_UploadImage extends Zend_Form {
    
    function init()
    {
        /*
         * THIS PROGRAM USE JUST 
         * 
         * ZendForm
         * 
         */
        
        $this->setMethod("POST");
        
        $upload = new Zend_Form_Element_File('uploadedfile');
        $upload->setLabel('Enviar arquivo:')
           ->setDestination('../public/db/user/photo');
        $upload->addValidator('Count', false, 1)
                ->addValidator('Extension', false, 'jpg,png,gif')
                ->setRequired(true);

        $grupo = new Zend_Form_Element_Select('grupo');
        $grupo->setLabel('Tipo:')
              ->addMultiOptions(array
                (
                'profile' => 'Foto de Perfil',
                'album' => 'Fotos de Album'
                ));
        
        $action = new Zend_Form_Element_Hidden('action');
        $action->setValue('imageUpload');

//        $description = $this->createElement('text','descricao',array('label'=>'Descricao'));
//        $description->addValidator('alnum');

//        $this->addElement($description);
        $this->addElement($grupo);
        $this->addElement($upload, 'upload');
        //$this->addElement($action);
        $this->addElement('hidden','action',array('value' => 'asdasd'));
        $this->addElement('submit','logar',array('label' => 'UpLoad'));
        
    }
}

?>
